Skip to content

Conversation

SandraAhlgrimm
Copy link
Contributor

This change adds the User-Agent header with value 'spring-ai' to the OpenAI API client implementation, bringing it in line with the Azure OpenAI implementation for consistent API monitoring and identification.

Changes Made

  • Added User-Agent header with value 'spring-ai' to OpenAiApi constructor
  • Maintains consistency with Azure OpenAI implementation
  • Improves API monitoring and identification capabilities

Testing

Code has been validated for syntax and follows existing repository patterns.

- Adds 'User-Agent: spring-ai' header to all OpenAI API requests
- Maintains consistency with Azure OpenAI implementation
- Header is set in the RestClient default headers configuration
- Helps OpenAI identify requests coming from Spring AI for analytics and support

Signed-off-by: Sandra Ahlgrimm <sandra.kriemann@gmail.com>
@SandraAhlgrimm SandraAhlgrimm force-pushed the add-user-agent-header-openai branch from 3ed2882 to e3aaf32 Compare September 29, 2025 12:36
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M3 milestone Sep 29, 2025
@ericbottard ericbottard self-assigned this Oct 3, 2025
@markpollack markpollack modified the milestones: 1.1.0.M3, 1.1.0.M4 Oct 20, 2025
@sobychacko
Copy link
Contributor

@SandraAhlgrimm Thanks for the PR! This is now merged. I added an extra commit with some refinements. See here: f6ff20a.

@sobychacko sobychacko closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants